package com.rain.cy.framework.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @description 创建主键id
 * @author 王宇林
 * @create 2020年6月4日14:49:32
 **/
@Slf4j
@Component
public class SequenceUtil{

    /**
     * 机器标识
     */
    private static final int DEFAULT_MACHINE_ID = 1;

    /**
     * 机器标识
     */
    private static final int DATA_CENTER_ID = 8;

    /**
     * redis中储存的最大机器标识
     */
    private static final int MAX_MACHINE_ID_IN_REDIS = 120;

    private static SnowFlake SNOW_FLAKE;



    public static Long getId() {
        return SNOW_FLAKE.nextId();
    }

    private SequenceUtil() {}


}
